package com.jxauaia.contest.controller;
import com.jxauaia.contest.common.response.Result;
import com.jxauaia.contest.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/files")
public class FileController {

    private final FileService fileService;

    @Autowired
    public FileController(FileService fileService) {
        this.fileService = fileService;
    }

    @GetMapping("/avatars")
    public Result<List<String>> getAllAvatars() {
        List<String> avatars = fileService.getAllAvatars();
        return Result.success(avatars);
    }
}